<?php
	class hanhkiemdb
	{
		public function Add($HanhKiem)
		{
			$sql = "INSERT INTO `tbl_hanhkiem`(`HanhKiem`) 
			VALUES ('$HanhKiem')";
			$data = new dataservice();
			return $data->ExecuteNonQuery($sql);
		}
		
		public function Delete($MaHanhKiem)
		{
			$sql = " DELETE FROM `tbl_hanhkiem` WHERE MaHanhKiem = $MaHanhKiem ";
			$data = new dataservice();
			return $data->ExecuteNonQuery($sql);
		}
		
		public function Update($MaHanhKiem,$HanhKiem)
		{
			$sql = "UPDATE `tbl_hanhkiem`
			 SET HanhKiem = '$HanhKiem'
				 WHERE MaHanhKiem = $MaHanhKiem "; 
			$data = new dataservice();
			return $data->ExecuteNonQuery($sql);
		}
		
		
	
		public function GetList($MaHanhKiem,$HanhKiem)
		{
			$sql = "SELECT * FROM `tbl_hanhkiem` WHERE 1";
			if($MaHanhKiem!="")
				$sql .= " AND MaHanhKiem = '$MaHanhKiem' ";
			if($HanhKiem!="")
				$sql .= " AND HanhKiem = '$HanhKiem' ";
			$data = new dataservice();
			return $data->ExecuteQuery($sql);
		}
		
	}
?>